﻿@model SESM.Models.Views.Server.NewServerViewModel
@{
    ViewBag.Title = "New Server";
    object labelClass = new { @class = "col-md-4 control-label" };

    const string valueColumn = "col-md-8";
    object valueClass = new { @class = "form-control" };
}
<script type='text/javascript'>
    $(document).ready(function () {
        $('.form-group').popover({ trigger: 'hover focus', placement: 'auto top', html: 'true' });
    });
</script>
@using (Html.BeginForm("Create", "Server", null, FormMethod.Post, new { @class = "form-horizontal well", role = "form" }))
{
    <div class="row">
        <div class="col-md-6">
            <section>
                <hr />
                <h3>Server Settings</h3>
                <hr />
                @Html.ValidationSummary()
                <div class="form-group" data-toggle="popover" data-content="The name displayed on the server list.">
                    @Html.LabelFor(m => m.Name, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.Name, valueClass)
                        @Html.ValidationMessageFor(m => m.Name)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, the server will be displayed in everyone server list, including guests.">
                    @Html.LabelFor(m => m.IsPublic, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.IsPublic, valueClass)
                        @Html.ValidationMessageFor(m => m.IsPublic)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The name displayed in the in-game server list.">
                    @Html.LabelFor(m => m.ServerName, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.ServerName, valueClass)
                        @Html.ValidationMessageFor(m => m.ServerName)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The world name displayed in the in-game server list. If Empty, the map name is used.">
                    @Html.LabelFor(m => m.WorldName, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.WorldName, valueClass)
                        @Html.ValidationMessageFor(m => m.WorldName)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The IP address on which the server will listen to.">
                    @Html.LabelFor(m => m.IP, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.IP, valueClass)
                        @Html.ValidationMessageFor(m => m.IP)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The port on which the server will listen to.">
                    @Html.LabelFor(m => m.ServerPort, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.ServerPort, valueClass)
                        @Html.ValidationMessageFor(m => m.ServerPort)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The port used to connect to steam.">
                    @Html.LabelFor(m => m.SteamPort, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.SteamPort, valueClass)
                        @Html.ValidationMessageFor(m => m.SteamPort)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, The server will use SE Server Extender to run.">
                    @Html.LabelFor(m => m.UseServerExtender, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.UseServerExtender, valueClass)
                        @Html.ValidationMessageFor(m => m.UseServerExtender)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The port used by SE Server Extender WCF interface.">
                    @Html.LabelFor(m => m.ServerExtenderPort, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.ServerExtenderPort, valueClass)
                        @Html.ValidationMessageFor(m => m.ServerExtenderPort)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, the server will restart at the interval defined by the cron below.">
                    @Html.LabelFor(m => m.AutoRestart, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.AutoRestart, valueClass)
                        @Html.ValidationMessageFor(m => m.AutoRestart)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The Cron for the Auto-Restart feature.">
                    @Html.LabelFor(m => m.AutoRestartCron, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.AutoRestartCron, valueClass)
                        @Html.ValidationMessageFor(m => m.AutoRestartCron)
                    </div>
                </div>
            </section>
        </div>
        <div class="col-md-6">
            <section>
                <hr />
                <h3>Game Settings</h3>
                <hr />
                <div class="form-group" data-toggle="popover" data-content="
                    <strong>Survival :</strong><br />You have to mine asteroids and grind ships to gather your materials.<br />
                    <strong>Creative :</strong><br />You can place every block without having to weld them.">
                    @Html.LabelFor(m => m.GameMode, labelClass)
                    <div class="@valueColumn">
                        @Html.EnumDropDownListFor(m => m.GameMode, null, valueClass)
                        @Html.ValidationMessageFor(m => m.GameMode)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="
                    <strong>SAFE :</strong><br />Nothing will fall from the sky, you can relax ...<br />
                    <strong>NORMAL :</strong><br />Cloudy, with a chance of meteors.<br />
                    <strong>CATACLYSM :</strong><br />You REALLY should take your iron umbrella !<br />
                    <strong>CATACLYSM_UNREAL :</strong><br />Basically , Run !!">
                    @Html.LabelFor(m => m.EnvironmentHostility, labelClass)
                    <div class="@valueColumn">
                        @Html.EnumDropDownListFor(m => m.EnvironmentHostility, null, valueClass)
                        @Html.ValidationMessageFor(m => m.EnvironmentHostility)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="
                    <strong>OFFLINE :</strong><br />The server will not be accessible at all.<br />
                    <strong>PUBLIC :</strong><br />The server will be visible for all in the in-game server list.<br />
                    <strong>FRIENDS :</strong><br />People will be able to connect to the server only if they have an friend connected to that server.<br />
                    <strong>PRIVATE :</strong><br />Same as the offline mode but you can connect fromm the host itself.">
                    @Html.LabelFor(m => m.OnlineMode, labelClass)
                    <div class="@valueColumn">
                        @Html.EnumDropDownListFor(m => m.OnlineMode, null, valueClass)
                        @Html.ValidationMessageFor(m => m.OnlineMode)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The maximum number of player allowed to join the server.">
                    @Html.LabelFor(m => m.MaxPlayers, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.MaxPlayers, valueClass)
                        @Html.ValidationMessageFor(m => m.MaxPlayers)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The maximum number of items allowed to exist on the server. If the number is reached, the oldest ones will be deleted.">
                    @Html.LabelFor(m => m.MaxFloatingObjects, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.MaxFloatingObjects, valueClass)
                        @Html.ValidationMessageFor(m => m.MaxFloatingObjects)
                    </div>
                </div>
            </section>
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
            <section>
                <hr />
                <h3>Multiplier Settings</h3>
                <hr />
                <div class="form-group" data-toggle="popover" data-content="The multiplier of the base welding speed. The bigger it is, the faster you will weld blocks.
                    <br /> Recomanded values are 0.5, 1, 2 or 5.">
                    @Html.LabelFor(m => m.WelderSpeedMultiplier, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.WelderSpeedMultiplier, null, valueClass)
                        @Html.ValidationMessageFor(m => m.WelderSpeedMultiplier)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The multiplier of the base grinding speed. The bigger it is, the faster you will grind blocks.
                    <br /> Recomanded values are 0.5, 1, 2 or 5.">
                    @Html.LabelFor(m => m.GrinderSpeedMultiplier, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.GrinderSpeedMultiplier, null, valueClass)
                        @Html.ValidationMessageFor(m => m.GrinderSpeedMultiplier)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The multiplier of the base grinding speed when hacking a block. The bigger it is, the faster an enemy will grind you blocks.
                    <br /> Recomanded values is 0.33.">
                    @Html.LabelFor(m => m.HackSpeedMultiplier, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.HackSpeedMultiplier, null, valueClass)
                        @Html.ValidationMessageFor(m => m.HackSpeedMultiplier)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The multiplier of the base Inventory size. The bigger it is, the larger your inventories will be.
                    <br /> Recomanded values are 1, 3, 5 or 10.">
                    @Html.LabelFor(m => m.InventorySizeMultiplier, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.InventorySizeMultiplier, null, valueClass)
                        @Html.ValidationMessageFor(m => m.InventorySizeMultiplier)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The multiplier of the base speed of the assemblers. The bigger it is, the faster your assemblers will be.
                    <br />Recomanded values are 1, 3, 5 or 10.">
                    @Html.LabelFor(m => m.AssemblerSpeedMultiplier, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.AssemblerSpeedMultiplier, null, valueClass)
                        @Html.ValidationMessageFor(m => m.AssemblerSpeedMultiplier)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The multiplier of the base efficiency of the assemblers. The bigger it is, the less raw materials your assemblers will consume.
                    <br />Recomanded values are 1, 3, 5 or 10.">
                    @Html.LabelFor(m => m.AssemblerEfficiencyMultiplier, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.AssemblerEfficiencyMultiplier, null, valueClass)
                        @Html.ValidationMessageFor(m => m.AssemblerEfficiencyMultiplier)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The multiplier of the speed of your refineries. The bigger it is, the faster your refineries will be.
                    <br />Recomanded values are 1, 3, 5 or 10.">
                    @Html.LabelFor(m => m.RefinerySpeedMultiplier, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.RefinerySpeedMultiplier, null, valueClass)
                        @Html.ValidationMessageFor(m => m.RefinerySpeedMultiplier)
                    </div>
                </div>
            </section>
        </div>
        <div class="col-md-6">
            <section>
                <hr />
                <h3>Gameplay Settings</h3>
                <hr />
                <div class="form-group" data-toggle="popover" data-content="If enabled, the players will heal any wound over time.">
                    @Html.LabelFor(m => m.AutoHealing, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.AutoHealing, valueClass)
                        @Html.ValidationMessageFor(m => m.AutoHealing)
                    </div>
                </div>

                <div class="form-group" data-toggle="popover" data-content="If enabled, the players will be able to use weapons.">
                    @Html.LabelFor(m => m.WeaponsEnabled, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.WeaponsEnabled, valueClass)
                        @Html.ValidationMessageFor(m => m.WeaponsEnabled)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, the players names will be showed over theirs head.">
                    @Html.LabelFor(m => m.ShowPlayerNamesOnHud, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.ShowPlayerNamesOnHud, valueClass)
                        @Html.ValidationMessageFor(m => m.ShowPlayerNamesOnHud)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, thrusters' flames will damage blocks.">
                    @Html.LabelFor(m => m.ThrusterDamage, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.ThrusterDamage, valueClass)
                        @Html.ValidationMessageFor(m => m.ThrusterDamage)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, random cargo-ships willspawn on your server.">
                    @Html.LabelFor(m => m.CargoShipsEnabled, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.CargoShipsEnabled, valueClass)
                        @Html.ValidationMessageFor(m => m.CargoShipsEnabled)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, it will change someting about the sound, probably...">
                    @Html.LabelFor(m => m.RealisticSound, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.RealisticSound, valueClass)
                        @Html.ValidationMessageFor(m => m.RealisticSound)
                    </div>
                </div>
            </section>
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
            <section>
                <hr />
                <h3>Map Settings</h3>
                <hr />
                <div class="form-group" data-toggle="popover" data-content="The boundaries of your server. Any object, player or ship will be destroyed if they go past the limit.">
                    @Html.LabelFor(m => m.WorldSizeKm, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.WorldSizeKm, null, valueClass)
                        @Html.ValidationMessageFor(m => m.WorldSizeKm)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, it will save the map state every below interval.">
                    @Html.LabelFor(m => m.AutoSave, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.AutoSave, valueClass)
                        @Html.ValidationMessageFor(m => m.AutoSave)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The interval in minutes at wich the auto save will fire.">
                    @Html.LabelFor(m => m.AutoSaveInMinutes, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.AutoSaveInMinutes, valueClass)
                        @Html.ValidationMessageFor(m => m.AutoSaveInMinutes)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, it will automaticly remove small piece of ships, if they are in a linar motion and unpowered.">
                    @Html.LabelFor(m => m.RemoveTrash, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.RemoveTrash, valueClass)
                        @Html.ValidationMessageFor(m => m.RemoveTrash)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, the spawn ships are deleted as soon as the players leave the server.">
                    @Html.LabelFor(m => m.RespawnShipDelete, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.RespawnShipDelete, valueClass)
                        @Html.ValidationMessageFor(m => m.RespawnShipDelete)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, players will be able to copy-paste ships in creative mode.">
                    @Html.LabelFor(m => m.EnableCopyPaste, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.EnableCopyPaste, valueClass)
                        @Html.ValidationMessageFor(m => m.EnableCopyPaste)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, players will be able to go into spectator mode.">
                    @Html.LabelFor(m => m.EnableSpectator, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.EnableSpectator, valueClass)
                        @Html.ValidationMessageFor(m => m.EnableSpectator)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, players will be able to save the map locally.">
                    @Html.LabelFor(m => m.ClientCanSave, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.ClientCanSave, valueClass)
                        @Html.ValidationMessageFor(m => m.ClientCanSave)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, a player who dies and who have no medbay to respawn will loose ownership on all his/her blocks.">
                    @Html.LabelFor(m => m.PermanentDeath, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.PermanentDeath, valueClass)
                        @Html.ValidationMessageFor(m => m.PermanentDeath)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, the server will pause itself when no player is connected.">
                    @Html.LabelFor(m => m.PauseGameWhenEmpty, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.PauseGameWhenEmpty, valueClass)
                        @Html.ValidationMessageFor(m => m.PauseGameWhenEmpty)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, and if lvl1 backups are enabled on a global scale, the map will be backuped on the lvl1 interval.">
                    @Html.LabelFor(m => m.IsLvl1BackupEnabled, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.IsLvl1BackupEnabled, valueClass)
                        @Html.ValidationMessageFor(m => m.IsLvl1BackupEnabled)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, and if lvl2 backups are enabled on a global scale, the map will be backuped on the lvl2 interval.">
                    @Html.LabelFor(m => m.IsLvl2BackupEnabled, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.IsLvl2BackupEnabled, valueClass)
                        @Html.ValidationMessageFor(m => m.IsLvl2BackupEnabled)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, and if lvl3 backups are enabled on a global scale, the map will be backuped on the lvl3 interval.">
                    @Html.LabelFor(m => m.IsLvl3BackupEnabled, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.IsLvl3BackupEnabled, valueClass)
                        @Html.ValidationMessageFor(m => m.IsLvl3BackupEnabled)
                    </div>
                </div>
            </section>
        </div>
        <div class="col-md-6">
            <section>
                <hr />
                <h3>In-Game Management Settings</h3>
                <hr />
                <div class="form-group" data-toggle="popover" data-content="If enabled, the server will reset all block ownership.">
                    @Html.LabelFor(m => m.ResetOwnership, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.ResetOwnership, valueClass)
                        @Html.ValidationMessageFor(m => m.ResetOwnership)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="If enabled, ??????????????">
                    @Html.LabelFor(m => m.IgnoreLastSession, labelClass)
                    <div class="@valueColumn">
                        @Html.CheckBoxFor(m => m.IgnoreLastSession, valueClass)
                        @Html.ValidationMessageFor(m => m.IgnoreLastSession)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The list of the administrators' steam's ids.
                    <br />One per line.">
                    @Html.LabelFor(m => m.Administrators, labelClass)
                    <div class="@valueColumn">
                        @Html.TextAreaFor(m => m.Administrators, valueClass)
                        @Html.ValidationMessageFor(m => m.Administrators)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The list of the banneds' steam's ids.
                    <br />One per line.">
                    @Html.LabelFor(m => m.Banned, labelClass)
                    <div class="@valueColumn">
                        @Html.TextAreaFor(m => m.Banned, valueClass)
                        @Html.ValidationMessageFor(m => m.Banned)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The list of the mods' steam's ids.
                    <br />One per line.">
                    @Html.LabelFor(m => m.Mods, labelClass)
                    <div class="@valueColumn">
                        @Html.TextAreaFor(m => m.Mods, valueClass)
                        @Html.ValidationMessageFor(m => m.Mods)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The authorised steam group.
                    <br />If other than 0, only the players who are part of this steam groupp will be allowed to connect.">
                    @Html.LabelFor(m => m.GroupID, labelClass)
                    <div class="@valueColumn">
                        @Html.TextBoxFor(m => m.GroupID, null, valueClass)
                        @Html.ValidationMessageFor(m => m.GroupID)
                    </div>
                </div>
            </section>
            <section>
                <hr />
                <h3>Web Management Settings</h3>
                <hr />
                <div class="form-group" data-toggle="popover" data-content="The list of the web administrators' logins.
                    <br />One per line.<br />Administrators can change every settings of the servers.">
                    @Html.LabelFor(m => m.WebAdministrators, labelClass)
                    <div class="@valueColumn">
                        @Html.TextAreaFor(m => m.WebAdministrators, valueClass)
                        @Html.ValidationMessageFor(m => m.WebAdministrators)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The list of the web managers' logins.
                    <br />One per line.<br />Managers can change some settings of the servers.">
                    @Html.LabelFor(m => m.WebManagers, labelClass)
                    <div class="@valueColumn">
                        @Html.TextAreaFor(m => m.WebManagers, valueClass)
                        @Html.ValidationMessageFor(m => m.WebManagers)
                    </div>
                </div>
                <div class="form-group" data-toggle="popover" data-content="The list of the web users' logins.
                    <br />One per line.<br />Users can see the server in theirs server list.">
                    @Html.LabelFor(m => m.WebUsers, labelClass)
                    <div class="@valueColumn">
                        @Html.TextAreaFor(m => m.WebUsers, valueClass)
                        @Html.ValidationMessageFor(m => m.WebUsers)
                    </div>
                </div>
            </section>
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
            <div class="col-md-offset-4 col-md-8">
                <input type="submit" value="Save" class="btn btn-primary" />
            </div>
        </div>
    </div>
}
<div class="row">
    <div class="col-md-12">
        <a class="btn btn-default" href="@(Url.Action("Index"))">
            <span class="glyphicon glyphicon-chevron-left"></span> Back to Server List
        </a>
    </div>
</div>
